package com.ruoyi.ebike.utils;

import java.util.Random;

public class GiftCardCodeUtils {
    private static final String PREFIX = "jpj";
    private static final int CODE_LENGTH = 4;
    public static String generateVerificationCode() {
        Random random = new Random();
        StringBuilder codeBuilder = new StringBuilder(PREFIX);

        for (int i = 0; i < CODE_LENGTH; i++) {
            int digit = random.nextInt(10); // 生成0到9之间的随机数字
            codeBuilder.append(digit);
        }

        return codeBuilder.toString();
    }

    public static void main(String[] args) {
        // 测试生成验证码的方法
        System.out.println(generateVerificationCode());
    }

}
